PROJECT = polaris-provider
LINUX_OUT = bin/linux/$(PROJECT)
WIN_OUT = bin/windows/$(PROJECT).exe

.PHONY: all linux windows clean

all: linux windows mac

linux:
	@echo "Building Linux version..."
	@GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o $(LINUX_OUT) main.go

windows:
	@echo "Building Windows version..."
	@GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc CGO_ENABLED=0 \
		go build -ldflags "-s -w" -o $(WIN_OUT) main.go

mac:
	@echo "Building macOS version..."
	@GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" -o bin/macos/$(PROJECT) main.go

clean:
	@rm -rf bin/
